<?php if ( ! defined('WDK_PATH')) exit('No direct script access allowed');
class Main extends Controller
{
	function __construct()
	{
		parent::__construct();
	}
	
	protected function _init() 
	{
		parent::_loginCheck();
	}
	
	public function index()
	{
		/*****************************************************************************************************************************
		 * BASIC VARS
		*****************************************************************************************************************************/
		$assign_data = array();
		/****************************************************************************************************************************/
		try
		{
			try
			{
				$lm = Wdk::get('UserManager');
				$lm['listsize'] = 10;
				$lm['page'] = 1;
				$lm['where'] = array();
				$lm->load();
				$assign_data['newbie'] = $lm['lists'];
			}
			catch(NoRecordException $e){}
			
			try
			{
				$lm = Wdk::get('PostManager');
				$lm['listsize'] = 30;
				$lm['page'] = 1;
				$lm->load();
				$assign_data['newpost'] = $lm['lists'];
			}
			catch(NoRecordException $e){}
		}
		catch(WException $e)
		{
			parent::_error($e);
		}
		/*****************************************************************************************************************************
		* RESULT
		*****************************************************************************************************************************/
		parent::_view($assign_data);
		/****************************************************************************************************************************/
	}
	
	public function main() 
	{
		parent::_redirect('/admin/');
	}
}